import { addNameSpace } from './util'

const NAME_SPACE = 'MAIN'

const addPrefix = addNameSpace(NAME_SPACE)

// 修改密码模态框显示
export const SHOW_MODAL_CHANGE_PWD = addPrefix('SHOW_MODAL_CHANGE_PWD')

// 修改密码模态框隐藏
export const HIDE_MODAL_CHANGE_PWD = addPrefix('HIDE_MODAL_CHANGE_PWD')

// 获取数据
export const GET_DATA = addPrefix('GET_DATA')

// 获取数据成功
export const GET_DATA_SUCCESS = addPrefix('GET_DATA_SUCCESS')

// 获取数据失败
export const GET_DATA_FAIL = addPrefix('GET_DATA_FAIL')

// 重置密码
export const RESET_PASS_WORD = addPrefix('RESET_PASS_WORD')

// 重置密码成功
export const RESET_PASS_WORD_SUCCESS = addPrefix('RESET_PASS_WORD_SUCCESS')

// 重置密码失败
export const RESET_PASS_WORD_FAIL = addPrefix('RESET_PASS_WORD_FAIL')

// 显示密码
export const SHOW_PASSWORD = addPrefix('SHOW_PASSWORD')

// 隐藏密码
export const HIDDEN_PASSWORD = addPrefix('HIDDEN_PASSWORD')

export const showModalChangPwd = () =>({ type: SHOW_MODAL_CHANGE_PWD })

export const hideModalChangPwd = () => ({ type: HIDE_MODAL_CHANGE_PWD })

export const getData = () => ({ type: GET_DATA })

export const getDataSuccess = (data) => ({ type: GET_DATA_SUCCESS, data })

export const getDataFail = () => ({ type: GET_DATA_FAIL })

export const resetPassWord = () => ({ type: RESET_PASS_WORD })

export const resetPassWordSuccess = () => ({ type: RESET_PASS_WORD_SUCCESS })

export const resetPassWordFail = () => ({ type: RESET_PASS_WORD_FAIL })

export const showPassword = () => ({ type: SHOW_PASSWORD })

export const hiddenPassword = () => ({ type: HIDDEN_PASSWORD })

export default {
  showModalChangPwd,
  hideModalChangPwd,
  getData,
  getDataSuccess,
  getDataFail,
  resetPassWord,
  resetPassWordSuccess,
  resetPassWordFail,
  showPassword,
  hiddenPassword,
}